package com.htl.exampro.paper.api;

import com.htl.exampro.base.model.PageResult;
import com.htl.exampro.base.model.ServerResponse;
import com.htl.exampro.paper.pojo.query.PaperPageParam;
import com.htl.exampro.paper.pojo.vo.PaperVO;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * PaperApi
 */
@FeignClient(name = "exam-pro-paper", contextId = "PaperApi", path = "/paper/paper")
public interface PaperApi {

    @Operation(summary = "查询试卷", description = "根据主键查询试卷信息")
    @GetMapping("/{id}")
    ServerResponse<PaperVO> queryPaperById(@PathVariable("id") String id);

    @Operation(summary = "分页查询试卷", description = "支持按条件分页查询试卷列表")
    @PostMapping("/page")
    ServerResponse<PageResult<PaperVO>> queryPaperPage(@Validated @RequestBody PaperPageParam pageParam);

    @Operation(summary = "保存试卷", description = "保存试卷")
    @PostMapping("")
    ServerResponse<Integer> savePaper(@Validated @RequestBody PaperVO paperVO);

    @Operation(summary = "修改试卷", description = "修改试卷")
    @PutMapping("")
    ServerResponse<Integer> updatePaper(@Validated @RequestBody PaperVO paperVO);

    @Operation(summary = "删除试卷", description = "根据主键删除试卷信息")
    @DeleteMapping("/{id}")
    ServerResponse<Boolean> delPaperById(@PathVariable("id") String id);

}
